/*
 * Copyright (c) 2023, 2024,yzc.cn All rights reserved.
 *
 */
package com.by.mq.config;

import com.alibaba.spring.beans.factory.annotation.EnableConfigurationBeanBinding;
import com.rabbitmq.client.AMQP;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <p>Project: erp-cloud-api - StatusMQConfig</p>
 * <p>Powered by yzc On 2024-01-11 17:50:55</p>
 * <p>描述：<p>
 *
 * @author yzc [yzc0415@126.com]
 * @version 1.0
 * @since 17
 */
@Configuration
public class StatusMQConfig {

    /**
     * 定义定价状态队列
     * @return
     */
    @Bean
    public Queue valuationStatusQueue(){
        return new Queue("valuationStatusQueue");
    }

    /**
     * 定义定价状态交换机
     * @return
     */
    @Bean
    public DirectExchange valuationStatusExchange(){
        return new DirectExchange("valuationStatusExchange");
    }

    /**
     * 绑定状态队列和交换器
     * @return
     */
    @Bean
    public Binding bindingStatus(Queue valuationStatusQueue,DirectExchange valuationStatusExchange){
        return BindingBuilder.bind(valuationStatusQueue).to(valuationStatusExchange).with("VStatus");
    }



}
